gui/tray: Present successful sync tray icon is we just have idle file provider accounts
authorClaudio Cambra <claudio.cambra@nextcloud.com>
Fri, 7 Feb 2025 02:09:30 +0000 (10:09 +0800)
committerMatthieu Gallien <matthieu.gallien@nextcloud.com>
Fri, 7 Feb 2025 08:59:16 +0000 (09:59 +0100)
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
src/gui/owncloudgui.cpp

index f383266479114662b413eb6da37ec0abebecff82..872635352bb5674ee4593906ea9332c64365c6ef 100644 (file)
@@ -313,6 +313,7 @@ void ownCloudGui::slotComputeOverallSyncStatus()
     QList<QString> problemFileProviderAccounts;
     QList<QString> syncingFileProviderAccounts;
     QList<QString> successFileProviderAccounts;
+    QList<QString> idleFileProviderAccounts;
 
     if (Mac::FileProvider::fileProviderAvailable()) {
         for (const auto &accountState : AccountManager::instance()->accounts()) {
@@ -329,6 +330,7 @@ void ownCloudGui::slotComputeOverallSyncStatus()
                 switch (const auto latestStatus = fileProvider->socketServer()->latestReceivedSyncStatusForAccount(accountState->account())) {
                 case SyncResult::Undefined:
                 case SyncResult::NotYetStarted:
+                    idleFileProviderAccounts.append(accountFpId);
                     break;
                 case SyncResult::SyncPrepare:
                 case SyncResult::SyncRunning:
@@ -343,7 +345,7 @@ void ownCloudGui::slotComputeOverallSyncStatus()
                 case SyncResult::SetupError:
                     problemFileProviderAccounts.append(accountFpId);
                     break;
-                case SyncResult::Paused:
+                case SyncResult::Paused: // This is not technically possible with VFS
                     break;
                 }
             }
@@ -405,7 +407,7 @@ void ownCloudGui::slotComputeOverallSyncStatus()
                overallStatus != SyncResult::Error &&
                overallStatus != SyncResult::SetupError) {
         overallStatus = SyncResult::SyncRunning;
-    } else if (!successFileProviderAccounts.isEmpty() &&
+    } else if ((!successFileProviderAccounts.isEmpty() || (problemFileProviderAccounts.isEmpty() && syncingFileProviderAccounts.isEmpty() && !idleFileProviderAccounts.isEmpty())) &&
                overallStatus != SyncResult::SyncRunning &&
                overallStatus != SyncResult::Problem &&
                overallStatus != SyncResult::Error &&